package com.jxzn.locust.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class CommonController {

    public String index() {
        return "index";
    }

    /**
     * 页面访问.
     * 
     * @param module
     * @param view
     * @return
     */
    @RequestMapping("{view}.html")
    public String page(@PathVariable String view) {
        return view;
    }

    /**
     * 页面访问.
     * 
     * @param module
     * @param view
     * @return
     */
    @RequestMapping("{module}/{view}.html")
    public String page(@PathVariable String module, @PathVariable String view) {
        return module + "/" + view;
    }

    @RequestMapping("/bg/{module}/{view}.html")
    public String admin(@PathVariable String module, @PathVariable String view) {
        return "bg/" + module + "/" + view;
    }

    @RequestMapping("/front/{view}.html")
    public String front(@PathVariable String view) {
        return "front/" + view;
    }

    @RequestMapping("/front/{module}/{view}.html")
    public String front(@PathVariable String module, @PathVariable String view) {
        return "front/" + module + "/" + view;
    }

}
